import torch

input_data = torch.rand(size=[10,10,10])

indices = torch.randint(0,10,[5,5,5])
update = torch.rand(size=[5,5,5])



result = torch.scatter(input=input_data, dim=0, index=indices, src=update, reduce="multiply")


import copy
numpy_result = copy.deepcopy(input_data)

for i in range(5):
    for j in range(5):
        for k in range(5):
            numpy_result[indices[i][j][k]][j][k] *= update[i][j][k]
    
stride, batch, reduce


print(numpy_result == result)
# print(numpy_result)
# print(result)